#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QLineEdit>
#include <QRegExp>
#include <QLabel>


namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();

    // 判断输入是否正确
    bool isInputContentFormCorrect(QLineEdit *lineedit, const QRegExp &reg);

    // 显示验证提示
    void showVerifyStatus(bool status, QLabel *hintLabel, QLabel *iconLabel, QString str);

private slots:

    void on_telEdit_editingFinished();

private:
    Ui::Widget *ui;

    QRegExp telReg = QRegExp("^1([38][0-9]|4[45789]|[59][0-35-9]|6[67]|7[1-35-8])[0-9]{8}$");
    QRegExp qqReg = QRegExp("^[1-9][0-9]{4,10}$");
    QRegExp nickNameReg = QRegExp("^[\\w\\u4e00-\\u9fa5]{6,20}$");
    QRegExp codeReg = QRegExp("^[0-9]{4}$");
    QRegExp pwdReg = QRegExp("^[\\w!@#$%^&]{8,20}$");
};

#endif // WIDGET_H
